package biolabs.mcl

import scala.collection.{Map => AMap}

import biolabs.core.Application
import biolabs.mcl.syntax._

object TypedIdentifier {
	def analyze(ast: TypedIdentifierAST, model: ModelDefinition, app: Application): AnalysisResult[TypedIdentifier] =
		MultiType.analyze(ast.tpe, model, model.typeParameterMap, app) match {
			case AnalysisSuccess(mt) => AnalysisSuccess(new TypedIdentifier(ast.name, mt))
			case AnalysisError(msg) => AnalysisError(msg)
		}
}

/** Represents an identifier with declared type,
  * as in "`x: Int`".
  */
case class TypedIdentifier private(val name: String, val tpe: MultiType)